﻿Option Explicit On
Option Strict On

Imports TfsProjectTools


Public Class TFSProjectAttribs
   Private myCollectionUri As Uri = Nothing
   Private myProjectName As String = String.Empty
   Private myProcessTemplateName As String = String.Empty
   Private myProjectAdminAccountName As String = String.Empty
   Private myWebAccessUri As String = String.Empty


   Public Sub New(ByVal collectionUri As Uri,
                  ByVal projectName As String,
                  ByVal processTemplateName As String,
                  ByVal projectAdminAccountName As String)

      If collectionUri Is Nothing Then
         Throw New ArgumentNullException("collectionUri")
      Else
         myCollectionUri = collectionUri
      End If

      If String.IsNullOrWhiteSpace(projectName) Then
         Throw New ArgumentNullException("projectName")
      Else
         myProjectName = projectName
      End If

      If String.IsNullOrWhiteSpace(processTemplateName) Then
         Throw New ArgumentNullException("processTemplateName")
      Else
         myProcessTemplateName = processTemplateName.Trim()
      End If

      If String.IsNullOrWhiteSpace(projectAdminAccountName) Then
         Throw New ArgumentNullException("projectAdminAccountName")
      Else
         myProjectAdminAccountName = projectAdminAccountName.Trim()
      End If
   End Sub

   Public ReadOnly Property CollectionUri() As Uri
      Get
         Return myCollectionUri
      End Get
   End Property

   Public ReadOnly Property ProjectName() As String
      Get
         Return myProjectName
      End Get
   End Property

   Public ReadOnly Property ProcessTemplateName() As String
      Get
         Return myProcessTemplateName
      End Get
   End Property

   Public ReadOnly Property ProjectAdminAccountName() As String
      Get
         Return myProjectAdminAccountName
      End Get
   End Property

   Public Property WebAccessUri() As String
      Get
         Return myWebAccessUri
      End Get
      Set(ByVal value As String)
         If Not String.IsNullOrWhiteSpace(value) Then
            myWebAccessUri = value
         End If
      End Set
   End Property
End Class
